import { defineConfig } from "wxt";
const isDev = process.env.NODE_ENV === "development";
// See https://wxt.dev/api/config.html
export default defineConfig({
  outDir: "dist",
  runner: {
    openConsole: true,
    openDevtools: true,
    disabled: true,
  },
  manifest: ({ mode }) => {
    const modeStr = mode === "development" ? " (开发)" : "(线上)";
    return {
      manifest_version: 3,
      name: `jira助手` + modeStr,
      version: "1.8.26",
      description: "jira助手" + modeStr,
      permissions: ["scripting"],
      host_permissions: ["https://jira.cjdropshipping.cn/*"],
      content_scripts: [
        {
          matches: ["https://jira.cjdropshipping.cn/*"],
          js: ["content-scripts/jira.js"],
          css: ["jira.css"],
        },
        {
          matches: ["https://fanyi.baidu.com/*"],
          js: ["content-scripts/fanyi.js"],
        },
      ],
    };
  },
  zip: {
    name: `jira助手 (${isDev ? "开发" : "线上"})`,
  },
});
